<!DOCTYPE html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>Drag and Drop events between Schedulers in dhtmlxLayout</title>
</head>
<script src="../../codebase/dhtmlxscheduler.js?v=5.3.10" type="text/javascript" charset="utf-8"></script>
<script src="../../codebase/ext/dhtmlxscheduler_drag_between.js?v=5.3.10" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="../../codebase/dhtmlxscheduler_material.css?v=5.3.10" type="text/css" media="screen" title="no title" charset="utf-8">

<script src="//cdn.dhtmlx.com/site/dhtmlx.js?v=5.3.10"></script>
<link rel="stylesheet" type="text/css" href="//cdn.dhtmlx.com/site/dhtmlx.css?v=5.3.10">

<style type="text/css" media="screen">
	html, body{
		margin:0px;
		padding:0px; height:100%;
	}
</style>

<script type="text/javascript" charset="utf-8">
	function init() {

		var dhxLayout = new dhtmlXLayoutObject(document.body, "2U");

		scheduler.config.multi_day = true;
		dhxLayout.cells("a").attachScheduler(new Date(2017,5,30), "week", null, scheduler);
		scheduler.load("./data/units.json");



		scheduler2 = Scheduler.getSchedulerInstance();
		scheduler2.config.multi_day = false;
		dhxLayout.cells("b").attachScheduler(new Date(2017,5,30), "month", null, scheduler2);
		scheduler2.load("./data/units.json");


		//just for the demo
		scheduler.attachEvent("onEventDragOut", function(id, event, e){
			dhtmlx.message("<b>" + event.text + "</b> is dragged from the scheduler<b>#1</b>");
			return true;
		});
		scheduler.attachEvent("onEventDropOut", function(id, event, to_scheduler, e){
			if(to_scheduler)
				dhtmlx.message("<b>" +event.text + "</b>  has gone from the scheduler<b>#1</b>");
			return true;
		});

		scheduler.attachEvent("onEventDragIn", function(id, event, e){
			dhtmlx.message("<b>" + event.text + "</b> is dragged into the scheduler<b>#1</b>");
			return true;
		});
		scheduler.attachEvent("onEventDropIn", function(id, event, to_scheduler, e){
			dhtmlx.message("<b>" + event.text + "</b> is added to the scheduler<b>#1</b>");
			return true;
		});

		scheduler2.attachEvent("onEventDragOut", function(id, event, e){
			dhtmlx.message("<b>" + event.text + "</b> is dragged from the scheduler<b>#2</b>");
			return true;
		});
		scheduler2.attachEvent("onEventDropOut", function(id, event, to_scheduler, e){
			if(to_scheduler)
				dhtmlx.message("<b>" + event.text + "</b>  has gone from the scheduler<b>#2</b>");
			return true;
		});

		scheduler2.attachEvent("onEventDragIn", function(id, event, e){
			dhtmlx.message("<b>" + event.text + "</b> is dragged into the scheduler<b>#2</b>");
			return true;
		});
		scheduler2.attachEvent("onEventDropIn", function(id, event, to_scheduler, e){
			dhtmlx.message("<b>" + event.text + "</b> is added to the scheduler<b>#2</b>");
			return true;
		});
	}
</script>

<body onload="init();">

</body>